package com.baemusic.common;

import java.io.IOException;
import java.util.Map;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryLoader;
import org.apache.commons.dbutils.QueryRunner;
import org.springframework.beans.factory.annotation.Autowired;

public class DataSourceDao {
	protected DataSource dataSource;
	protected QueryRunner queryRunner = new QueryRunner();

	public DataSource getDataSource() {
		return dataSource;
	}

	public void setDataSource(DataSource dataSource) {
		this.dataSource = dataSource;
	}

	protected Map<String, String> sqls;

	public DataSourceDao() {
		super();
		try {
			getClass().getResource("");
			sqls = QueryLoader.instance().load(
					"/com/baemusic/dao/" + getClass().getSimpleName()
							+ ".properties");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
